import * as React from 'react';
import Checkbox from '@mui/material/Checkbox';
import FormControlLabel from '@mui/material/FormControlLabel';
export default function SliderSx(props) {
  const [checked, setChecked] = React.useState(props.selected);
  const handleChange = (event) => {
    setChecked(event.target.checked);
  };
  return (
    <FormControlLabel 
                onClick={() => {
                    console.log('TagElement onClick');
                    if (props.onclick_func != null) {
                      console.log('props.onclick_func');
                      props.onclick_func();
                    }
                    // if (
                    //   this.state.selected &&
                    //   this.props.options &&
                    //   this.props.options.autoRemove !== false
                    // ) {
                    //   this.setState((state) => ({
                    //     selected: false,
                    //     hidden: true,
                    //     ...state,
                    //   }));
                    // } else {
                    //   this.setState((state) => ({ selected: true, ...state }));
                    // }
                }}
   control={<Checkbox  checked={checked}
      onChange={handleChange} />} label={props.tag} />);
}
